﻿package mortal.game.scene3D.ai.ais
{
    import flash.utils.*;
    import mortal.game.scene3D.ai.base.*;

    public class DelayAI extends AICommand
    {
        private var timerId:int = -1;
        private var _startTime:int;

        public function DelayAI()
        {
            return;
        }// end function

        override public function start(param1:Function = null) : void
        {
            super.start(param1);
            var _loc_2:* = int(data.params);
            if (_loc_2 <= 0)
            {
                this.stop();
            }
            this.timerId = setTimeout(this.stop, _loc_2);
            this._startTime = getTimer();
            return;
        }// end function

        override public function stop(param1:Boolean = true) : void
        {
            if (this.timerId > 0)
            {
                clearTimeout(this.timerId);
                this.timerId = -1;
            }
            super.stop(param1);
            return;
        }// end function

    }
}
